using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class vt_test5Map : EntityTypeConfiguration<vt_test5>
    {
        public vt_test5Map()
        {
            // Primary Key
            this.HasKey(t => new { t.vendor, t.account__ });

            // Properties
            this.Property(t => t.Vendor__)
                .HasMaxLength(10);

            this.Property(t => t.vendor)
                .IsRequired()
                .HasMaxLength(35);

            this.Property(t => t.account__)
                .IsRequired()
                .HasMaxLength(40);

            // Table & Column Mappings
            this.ToTable("vt_test5");
            this.Property(t => t.Vendor__).HasColumnName("Vendor_#");
            this.Property(t => t.vendor).HasColumnName("vendor");
            this.Property(t => t.account__).HasColumnName("account_#");
            this.Property(t => t.currency_difference).HasColumnName("currency_difference");
            this.Property(t => t.base1_difference).HasColumnName("base1_difference");
            this.Property(t => t.base2_difference).HasColumnName("base2_difference");
        }
    }
}
